/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package blueprint4j.report.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

//TODO: Used to extend extends DataPanel


public class DPanelReport implements ActionListener {
	
	//TODO: Must uncomment this code for reporting - This is a temp fix. DO NOT DELETE.
	//private JButton refresh = new JButton("Refresh");
	
//	private BindableProperties b_properties = new BindableProperties();
//	private Binder b_binder = new Binder();
//	private FieldReport field=null;
//	private JPanel report_panel = new JPanel();
//	private DBConnection dbcon = null;
//	
//	private String name = null;
//	private Bindable bindable = null;
//
//	public DPanelReport(DBConnection dbcon,String name,FieldReport p_field){
//		this.field = p_field;
//		this.name = name;
//		this.dbcon = dbcon;
//		report_panel.setLayout(new BorderLayout());
//		field.addToBindable(b_properties);
//		//refresh.addActionListener(this);
//	}
//
//	public String getName() {
//		return name;
//	}
//	
	public void actionPerformed(ActionEvent event) {
//		removeAll();
	}
//	
//	public void build(Binder binder,Bindable bindable)
//	throws IOException, BindException {
//		this.bindable = bindable;
//		if (field.getBindField() != null && field.getBindField().length > 0) {
//			add(field.createDataGroup(b_binder));
//		}
//		add(report_panel);
//		buildReport(bindable);
//	}
//
//	private void buildReport(Bindable bindable) {
//		try {
//			report_panel.removeAll();
//			b_binder.intoBindings();
//			/*
//			Report rpt = new Report(
//				dbcon,field.getReportName(),
//				new VectorBindable(new Bindable[]{b_properties,bindable})
//			);
//			rpt.build();
//			*/
//			Report rpt = field.get();
//			report_panel.setPreferredSize(new Dimension(rpt.getPrint().getPageWidth(),rpt.getPrint().getPageHeight()+85));
//			report_panel.add(new JRViewer(rpt.getPrint()),BorderLayout.CENTER);
//		} catch (Exception exception) {
//			Log.debug.out(exception);
//		}
//	}
	
	public void activate() {}
	public void deactivate() {}
	
	public void activated() {}
	public void deactivated() {}
}

